import org.openide.util.datatransfer.ClipboardEvent;
import org.openide.util.datatransfer.ClipboardListener;

class MyClipboardListener implements ClipboardListener
{
	public ClipboardEvent ev;
	
	private TextTransfer tt;
	private ClipboardHinstory cbh;
	
	public MyClipboardListener(TextTransfer tt,
			ClipboardHinstory cbh)
	{
		this.tt = tt;
		this.cbh = cbh;
	}

	public void clipboardChanged(ClipboardEvent ev)
	{
		System.out.println("clipboard changed!");
		this.ev = ev;
		cbh.add(tt.getClipboardContents());
	}
}